package com.zdxlz.fcmp.common.mybatis.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description：IPSec模板配置表【IKE加密算法】枚举类
 * @Author： aman
 * @Date： 2025/2/8 10:54
 */
@Getter
@AllArgsConstructor
public enum IkeEncryptAlgorithmEnum {
    IKE_DES(1, "DES"),
    IKE_3DES(2, "3DES"),
    IKE_AES128(3, "AES128"),
    IKE_AES192(4, "AES192"),
    IKE_AES256(5, "AES256"),
    IKE_SM4(6, "SM4"),
    ;
    @EnumValue
    private final Integer code;
    private final String name;

    public static IkeEncryptAlgorithmEnum getByCode(Integer code) {
        for (IkeEncryptAlgorithmEnum ikeEncryptAlgorithmEnum : IkeEncryptAlgorithmEnum.values()) {
            if (ikeEncryptAlgorithmEnum.getCode() == code) {
                return ikeEncryptAlgorithmEnum;
            }
        }
        return null;
    }

    @JsonValue
    public int getCode() {
        return code;
    }
}
